/**
 * 权限定义
 */
export const ACCESS_ENUM = {
  NOT_LOGIN: 'notLogin',
  // USER: 'user',
  // ADMIN: 'admin',
  SYSTEM_ADMIN: '0',
  EQUIPMENT_ADMIN: '1',
  PROPERTY_ADMIN: '2',
  REPAIR_ADMIN: '3',
  USER: '4',
  LEADER: '5'
}
export const ACCESS_MAP = {
  '0': { value: '系统管理员', color: 'green' },
  '1': { value: '设备管理员', color: 'blue' },
  '2': { value: '物业管理员', color: 'purple' },
  '3': { value: '维修管理员', color: 'orange' },
  '4': { value: '普通用户', color: 'cyan' },
  '5': { value: '领导', color: 'red' }
}

export const GET_ACCESS_MAP_OPTION = (key) => {
  return ACCESS_MAP[key]
}

export const GET_ACCESS_MAP_OPTIONS_BY_KEY = (arr) => {
  return arr.map(key => ACCESS_MAP[key].value)
}
export const GET_ACCESS_MAP_OPTIONS = Object.keys(ACCESS_MAP).map((key) => {
  return {
    value: ACCESS_MAP[key].value
  }
})
